<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Order extends Model
{
    //
    use SoftDeletes;

    protected $casts=[
        'channel_info'=>'json',
        'userinfo'=>'json',
        'confirm_loan'=>'json',
    ];

    protected $dates=['deleted_at'];

    protected $fillable=['channel_info','userinfo','status','reason','confirm_loan','mid','parent_mid'];


    public function product(){
        return $this->hasOne(Product::class,'userinfo->apply_type',id);
    }
}
